CREATE EXTERNAL TABLE jms_dm.dm_barscan_user_scan_summary_hour_dt(
    scan_date                    string comment '扫描日期'
    ,scan_type                   string comment '扫描类型'
    ,scan_site_code              string comment '扫描站点code'
    ,scan_site_name              string comment '扫描站点名称'
    ,scan_site_type              string comment '扫描网点类型 1.加盟商,2.转运中心,3.集散点,4.普通网点,5.代理区,6.总部,0.其他'
    ,site_agent_code             string comment '所属代理区code'
    ,site_agent_name             string comment '所属代理区名称'
    ,site_center_code            string comment '所属转运中心code'
    ,site_center_name            string comment '所属转运中心名称'
    ,scan_user_code              string comment '扫描账户code'
    ,scan_user_name              string comment '扫描账户名称'
    ,hour_segment1_scan_cnt      bigint comment '时间段1扫描次数(00点-01点)'
    ,hour_segment2_scan_cnt      bigint comment '时间段2扫描次数(01点-02点)'
    ,hour_segment3_scan_cnt      bigint comment '时间段3扫描次数(02点-03点)'
    ,hour_segment4_scan_cnt      bigint comment '时间段4扫描次数(03点-04点)'
    ,hour_segment5_scan_cnt      bigint comment '时间段5扫描次数(04点-05点)'
    ,hour_segment6_scan_cnt      bigint comment '时间段6扫描次数(05点-06点)'
    ,hour_segment7_scan_cnt      bigint comment '时间段7扫描次数(06点-07点)'
    ,hour_segment8_scan_cnt      bigint comment '时间段8扫描次数(07点-08点)'
    ,hour_segment9_scan_cnt      bigint comment '时间段9扫描次数(08点-09点)'
    ,hour_segment10_scan_cnt     bigint comment '时间段10扫描次数(09点-10点)'
    ,hour_segment11_scan_cnt     bigint comment '时间段11扫描次数(10点-11点)'
    ,hour_segment12_scan_cnt     bigint comment '时间段12扫描次数(11点-12点)'
    ,hour_segment13_scan_cnt     bigint comment '时间段13扫描次数(12点-13点)'
    ,hour_segment14_scan_cnt     bigint comment '时间段14扫描次数(13点-14点)'
    ,hour_segment15_scan_cnt     bigint comment '时间段15扫描次数(14点-15点)'
    ,hour_segment16_scan_cnt     bigint comment '时间段16扫描次数(15点-16点)'
    ,hour_segment17_scan_cnt     bigint comment '时间段17扫描次数(16点-17点)'
    ,hour_segment18_scan_cnt     bigint comment '时间段18扫描次数(17点-18点)'
    ,hour_segment19_scan_cnt     bigint comment '时间段19扫描次数(18点-19点)'
    ,hour_segment20_scan_cnt     bigint comment '时间段20扫描次数(19点-20点)'
    ,hour_segment21_scan_cnt     bigint comment '时间段21扫描次数(20点-21点)'
    ,hour_segment22_scan_cnt     bigint comment '时间段22扫描次数(21点-22点)'
    ,hour_segment23_scan_cnt     bigint comment '时间段23扫描次数(22点-23点)'
    ,hour_segment24_scan_cnt     bigint comment '时间段24扫描次数(23点-24点)'
    ,total_scan_cnt              bigint comment '总扫描次数'
    ,operate_hour                bigint comment '操作时长'
)
COMMENT '智能设备-用户扫描次数'
PARTITIONED BY (
  `dt` string COMMENT '时间分区(yyyy-MM-dd)')
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  'hdfs://yl-bg-hdp/dw/hive/jms_dm.db/external/dm_barscan_user_scan_summary_hour_dt'
;
